package com.long1008.mapper;

import com.long1008.pojo.Hr;
import com.long1008.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface HrMapper {
    Hr loadUserByUsername(String username);

    List<Role> getRolesByHrId(Long id);

    int hrReg(
            @Param("name") String name,
            @Param("username") String username,
            @Param("password") String password,
            @Param("telephone") String telephone,
            @Param("phone") String phone,
            @Param("address") String address,
            @Param("userface") String userface);

    List<Hr> getHrsByKeywords(@Param("keywords") String keywords);

    int updateHr(Hr hr);

    int updateByPrimaryKey(Hr record);

    Hr selectByPrimaryKey(Integer id);

    Integer updatePasswd(@Param("hrid") Integer hrid, @Param("encodePass") String encodePass);

    Integer updateUserface(@Param("url") String url, @Param("id") Integer id);

    int deleteRoleByHrId(Long hrId);

    int addRolesForHr(@Param("hrId") Long hrId, @Param("rids") Long[] rids);

    Hr getHrById(Long hrId);

    int deleteHr(Long hrId);

    List<Hr> getAllHr(@Param("currentId") Long currentId);
}
